/*
 * Created on Feb 24, 2005
 */
import java.awt.*;
import java.awt.event.*;

class Tracker implements ComponentListener {
	private int height = 400, width = 600;
	boolean redraw = false;

    public Tracker() {
    }
    
    public void componentHidden(ComponentEvent e) {
	// empty
    }

    public void componentMoved(ComponentEvent e) {
    }

    public void componentResized(ComponentEvent e) {
    	setDimensions(e);
    }
    
    public void componentShown(ComponentEvent e) {
    	setDimensions(e);
    }
    private void setDimensions(ComponentEvent e) {
    	Component c = e.getComponent();
    	Dimension d = c.getSize();
    	
    	height = d.height;
    	width = d.width;
    	redraw=true;
    }
    
    public int getHeight() {
    	return height;
    }
    
    public int getWidth() {
    	return width;
    }
    
    public boolean isRedraw() {
    	if(!redraw) {
    		return false;
    	}else {
    		redraw = false;
    		return true;
    	}
    }
/*
    private void showGeometry(ComponentEvent e) {
     Component c = e.getComponent();
     Dimension d = c.getSize();
     Point p = c.getLocation();

    ("Position: (" + p.x +
          "," + p.y + ") Size: )" +
   		  d.width + "," + d.height + ")");
   }*/
}